package animation.model;


/**
 * Created by IntelliJ IDEA.
 * User: emilio
 * Date: Aug 17, 2004
 * Time: 11:02:11 PM
 * To change this template use File | Settings | File Templates.
 */
public class DescendingDataModel
        implements SortDataModel

{
    private int begin;

    public DescendingDataModel(int begin)
    {
        this.begin = begin;
    }

    public int[] fill(int length)
    {
        int[] array = new int[length];
        for (int i = 0; i < length; i++) {
            array[i] = length - (i + begin) % length;
        }
        return array;
    }

    public String toString()
    {
        return begin == 0 ? "Descending" : "~Descending";
    }

}
